#define _CRT_SECURE_NO_WARNINGS
class Solution {
public:
    int missingNumber(vector<int>& nums) {
        int n = nums.size();
        for (int i = 0; i <= n; i++)
            nums.push_back(i);
        int ret = 0;
        for (auto e : nums)
        {
            ret ^= e;
        }
        return ret;
    }
};